package com.zhu.gmallpublisher.service.impl;

import com.zhu.gmallpublisher.bean.UserChangeCtPerType;
import com.zhu.gmallpublisher.bean.UserPageCt;
import com.zhu.gmallpublisher.bean.UserTradeCt;
import com.zhu.gmallpublisher.mapper.UserStatsMapper;
import com.zhu.gmallpublisher.service.UserStatsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserStatsServiceImpl implements UserStatsService {

    @Autowired
    private UserStatsMapper userStatsMapper;

    /**
     * 独立用户  新增用户  回流用户统计
     * @param date
     * @return
     */
    @Override
    public List<UserChangeCtPerType> getUserChangeCt(Integer date) {
        return userStatsMapper.selectUserChangeCtPerType(date);
    }


    /**
     * 用户行为漏斗分析
     * @param date
     * @return
     */
    @Override
    public List<UserPageCt> getUserPageCt(Integer date) {
        return userStatsMapper.selectUserPageCt(date);
    }


    /**
     *新增交易和下单用户
     * @param date
     * @return
     */
    @Override
    public List<UserTradeCt> getTradeUserCt(Integer date) {
        return userStatsMapper.selectTradeUserCt(date);
    }
}
